package thinkinginjava.container;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

public class SetDemos {
	public static void main(String[] args) {
		Set<String> set = new LinkedHashSet<String>();
		for(int i = 0; i < 20; i ++) {
			set.add("abc_" + i);	
		}
		System.out.println(set);
		
		
		List<String> list = new ArrayList<String>(set);
		System.out.println(list.size());
		Iterator<String> it = list.iterator();
		for(; it.hasNext(); ) {
			String s = it.next();
			System.out.println(s);
			it.remove();	
		}
		System.out.println(list);
	}
}
